module Npc (
    pc,immediate,rs,Jump,Branch,instr,result
);
    input [31:0] pc;
    input [31:0] immediate;
    input [31:0] rs;
    input [1:0] Jump;
    input [1:0] Branch;
    input [31:0] instr;
    parameter   JUMP = 2'b01,JR_JUMP=2'b10, NOJUMP = 2'b00;                     // Jump

    output reg  [31:0]result;
    parameter   BRANCHE = 2'b01,BRANCHN=2'b10, NOBRANCH = 2'b00;  
    always @(*) begin
        if(Branch==BRANCHE||Branch==BRANCHN)
            result = pc + (immediate<<2);
        else if (Jump==JUMP)
            result = {pc[31:28], {instr[25:0] << 2}};
        else if(Jump==JR_JUMP)
            result = rs;
    end
endmodule //adder